﻿Imports DTO
Imports DAO
Public Class KhachHangBUS
    Public Shared Function LayDSKhachHang() As DataTable
        Return KhachHangDAO.LayDSKhachHang()
    End Function

    Public Shared Function ThemKhachHang(kh As KhachHangDTO) As Boolean
        Dim kt As Boolean = True
        If kh.TenKhachHang.Length = 0 Then
            Return False
        End If
        KhachHangDAO.ThemKhachHang(kh)
        Return kt
    End Function

    Public Shared Function CapNhatKhachHang(kh As KhachHangDTO) As Boolean
        Dim kt As Boolean = True
        If kh.TenKhachHang.Length = 0 Then
            Return False
        End If
        KhachHangDAO.CapNhatKhachHang(kh)
        Return kt
    End Function

    Public Shared Function XoaKhachHang(kh As KhachHangDTO) As Boolean
        Dim kt As Boolean = True
        If kh.MaKhachHang.Length = 0 Then
            Return False
        End If
        KhachHangDAO.XoaKhachHang(kh)
        Return kt
    End Function

    Public Shared DongKetNoi As SqlClient.SqlConnection = CKetNoi.Connect

    Public Shared Sub LayMaKhoHangCbx(ByVal makh As String, ByRef makv As String)
        KhachHangDAO.LayMaKhoHangCbx(makh, makv)
    End Sub

End Class
